package com.zrar.ak.gkpt.dao;

import com.zrar.ak.gkpt.model.bo.BusinessAccountBasicInfoBO;
import com.zrar.ak.gkpt.model.bo.BusinessBidPurchaseBidBO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IBusinessBidPurchaseBidDao
 * @Description 招标采购-招标表Dao层
 * @Author HuangKeXin
 * @Time 2020/04/3
 */
@Repository("businessBidPurchaseBidDao")
public interface IBusinessBidPurchaseBidDao extends Mapper<BusinessBidPurchaseBidBO> {
    @Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_BID_PURCHASE_BID WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByBusinessBidUnitId(String unitId);

    @Update(" UPDATE BUSINESS_BID_PURCHASE_BID SET IS_DELETE='1' WHERE IS_DELETE='0' AND UNIT_ID = #{unitId}")
    void deleteBusinessBidByUnitId(String unitId);

    Integer queryBusinessBidShowNum(Map map);

    List<BusinessBidPurchaseBidBO> pagingQueryBusinessBidList(Map map);

    BusinessBidPurchaseBidBO queryStatusByUnitId(String unitId);
}
